/**********************************************************************************
// Explosion Header File
// 
// Creation:	12 Out 2009
// Updated:		20 Apr 2011
// Compiler:	Visual Studio 2010
//
// Notes:		Create explosions for asteroids game
//
**********************************************************************************/

#ifndef _EFFECTS_H_
#define _EFFECTS_H_

#include "Missile.h"
#include "Vector.h"

#include <algorithm>
#include <iterator>
#include <list>
using std::list;

/**********************************************************************************/

class Explosion
{
private:
	list<Missile *> particles;			// list of missiles which make up the particles
	list<Missile *>::iterator ipar;		// iterator for fixed objects list
	LARGE_INTEGER start;				// starting time
	LARGE_INTEGER end;					// ending time
	LARGE_INTEGER freq;					// counter frequency
	LONGLONG duration;					// duration of effect
	int colorDimming;					// amount of dimming after each frame

public:
	Explosion();						// constructor
	~Explosion();						// destructor

	bool Active();						// return state of animation
	
	void InitParticles(float x, float y,// create particles from position (x,y) 
		               int num,			// number of particles
					   float lifetime,  // livetime in seconds
					   Color col);		// points color

	void DrawParticles();				// draw particles onscreen
	void MoveParticles();				// move particles during specified time
};


/**********************************************************************************/

#endif